package com.xuexiang.xuidemo.slice.status;

import com.xuexiang.xuidemo.ResourceTable;
import com.xuexiang.xuidemo.ability.StatusLayoutAbility;
import com.xuexiang.xuidemo.slice.BaseAbilitySlice;

import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;
import ohos.event.commonevent.CommonEventData;
import ohos.event.commonevent.CommonEventManager;
import ohos.event.commonevent.CommonEventSubscribeInfo;
import ohos.event.commonevent.CommonEventSubscriber;
import ohos.event.commonevent.MatchingSkills;
import ohos.hiviewdfx.HiLog;
import ohos.rpc.RemoteException;
import ohos.utils.PacMap;

public class StatusLayoutMainSlice extends BaseAbilitySlice {

    @Override
    protected int getTitleBarId() {
        return ResourceTable.Id_title_bar;
    }

    @Override
    protected int getUIContentLayoutId() {
        return ResourceTable.Layout_ability_slice_status_layout;
    }


    @Override
    protected void initComponents() {
        findComponentById(ResourceTable.Id_status_btn).setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                presentForResult(new StatefulLayoutSlice(), new Intent(), 1000);
            }
        });
        findComponentById(ResourceTable.Id_multiple_btn).setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                presentForResult(new MultipleStatusViewSlice(), new Intent(), 2000);
            }
        });
        findComponentById(ResourceTable.Id_status_view_btn).setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                presentForResult(new StatusViewLayoutSlice(), new Intent(), 3000);
            }
        });
        findComponentById(ResourceTable.Id_status_loader_btn).setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                presentForResult(new StatusLoaderSlice(), new Intent(), 4000);
            }
        });

    }

    @Override
    protected void onStop() {
        super.onStop();
    }

    @Override
    protected void onResult(int requestCode, Intent resultIntent) {
        super.onResult(requestCode, resultIntent);
        switch (requestCode) {
            case 1000:
            case 2000:
            case 3000:
            case 4000:
                break;
        }
    }
}
